package utn.tsb.tsbxml;

import java.util.ArrayList;
import java.util.HashMap;

public class Nodo {

    private String name;
    private String value;
    private ArrayList<Nodo> nodos;
    private HashMap<String, String> attributes;

    public Nodo(){
        this.nodos = new ArrayList<Nodo>();
        this.attributes = new HashMap<String, String>();
    }

    public Nodo(String name, String value){
        this.name = name;
        this.value = value;
        this.nodos = new ArrayList<Nodo>();
        this.attributes = new HashMap<String, String>();
    }

    public void addNodo(Nodo nodo){
        this.nodos.add(nodo);
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * @return the nodos
     */
    public ArrayList<Nodo> getNodos() {
        return nodos;
    }

    /**
     * @param nodos the nodos to set
     */
    public void setNodos(ArrayList<Nodo> nodos) {
        this.nodos = nodos;
    }

    public void addAttribute(String key, String val){
        this.getAttributes().put(key, val);
    }

    /**
     * @return the attributes
     */
    public HashMap<String, String> getAttributes() {
        return attributes;
    }

}
